/*********************************************************
          File Name:16.50.cpp
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Sun 20 Dec 2015 03:49:54 PM CST
**********************************************************/

#include <iostream>

using std::cout;
using std::endl;

template<typename T> void f(T x)
{
        cout << "f(T) => " <<x << endl;
}

template<typename T> void f(const T *x)
{
        cout << "f(const T*) => " << *x << endl;
}

template<typename T> void g(T x)
{
        cout << "g(T) => " << x << endl;
}

template<typename T> void g(T *x)
{
        cout << "g(T*) => " << *x << endl;
}

int main()
{
        int i = 42, *p = &i;
        const int ci = 0, *p2 = &ci;

        g(42); g(p); g(ci); g(p2);
        f(42); f(p); f(ci); f(p2);

        return 0;
}
